fix: Update log analytics destination name variable in Bicep#926
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Log Analytics destination naming used by the Windows VM Data Collection Rule (DCR) to be dynamically generated (instead of a hardcoded string), and synchronizes the generated ARM template accordingly.
Changes:
- Introduced a
dcrLogAnalyticsDestinationNamevariable in bothinfra/main.bicepandinfra/main_custom.bicepand updated the DCR configuration to reference it. - Updated
infra/main.jsonto include the new variable and use it in the DCRdestinations.logAnalytics[].nameanddataFlows[].destinationsfields. - Re-ordered a couple of
dependsOnarrays ininfra/main.jsonand updated the template hash.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| infra/main.bicep | Adds a variable for the DCR Log Analytics destination name and replaces hardcoded references with the variable. |
| infra/main_custom.bicep | Mirrors the same DCR destination naming change as main.bicep for the custom deployment path. |
| infra/main.json | Reflects the compiled output changes: new variable, updated DCR destination references, and updated template hash / dependency ordering. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Prajwal-Microsoft
approved these changes
May 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
This pull request updates the naming and usage of the Log Analytics destination for data collection rules in both Bicep and generated ARM template files. The changes improve maintainability and consistency by replacing hardcoded values with dynamically generated variable names, and ensure correct resource dependencies.
Log Analytics Destination Naming Improvements:
dcrLogAnalyticsDestinationNamein bothinfra/main.bicepandinfra/main_custom.bicepto generate the Log Analytics destination name dynamically, replacing the previous hardcoded value. [1] [2]'la--1264800308', ensuring consistency across log destinations and workspace associations. [1] [2] [3] [4] [5] [6]ARM Template Synchronization:
infra/main.jsonARM template, including parameter and variable definitions, and updated all relevant resource properties to usedcrLogAnalyticsDestinationName. [1] [2] [3] [4]infra/main.jsonto reflect the changes.Resource Dependency Ordering:
infra/main.jsonfor private DNS zones, ensuring correct deployment sequencing for cognitive services and storage resources. [1] [2]Does this introduce a breaking change?
Golden Path Validation
Deployment Validation
What to Check
Verify that the following are valid
Other Information